CREATE TABLE [dbo].[T_BIOPSY]
(
[BIOPSY_ID] [bigint] NOT NULL IDENTITY(1, 1),
[BIOPSY_CODE] [varchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[CUSTOMER_ID] [bigint] NULL,
[PRODUCT_ID] [bigint] NULL,
[MEDICAL_CENTER_ID] [bigint] NULL,
[BIOPSY_DOCTOR_ID] [bigint] NULL,
[BIOPSY_SAMPLING_DATE] [datetime] NOT NULL,
[BIOPSY_SHIPPING_DATE] [datetime] NOT NULL,
[MEDICAL_PROCEDURE_ID] [bigint] NULL,
[CLINICAL_COMMENT] [varchar] (max) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[DIAGNOSITC_IMPRESSION] [varchar] (max) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
ALTER TABLE [dbo].[T_BIOPSY] ADD CONSTRAINT [PK__T_BIOPSY__63C1924FBE928101] PRIMARY KEY CLUSTERED  ([BIOPSY_ID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[T_BIOPSY] ADD CONSTRAINT [FK__T_BIOPSY__BIOPSY__4F47C5E3] FOREIGN KEY ([BIOPSY_DOCTOR_ID]) REFERENCES [dbo].[T_DOCTOR] ([DOCTOR_ID])
GO
ALTER TABLE [dbo].[T_BIOPSY] ADD CONSTRAINT [FK__T_BIOPSY__CUSTOM__4C6B5938] FOREIGN KEY ([CUSTOMER_ID]) REFERENCES [dbo].[T_CUSTOMER] ([CUSTOMER_ID])
GO
ALTER TABLE [dbo].[T_BIOPSY] ADD CONSTRAINT [FK__T_BIOPSY__MEDICA__4E53A1AA] FOREIGN KEY ([MEDICAL_CENTER_ID]) REFERENCES [dbo].[T_MEDICAL_CENTER] ([MEDICAL_CENTER_ID])
GO
ALTER TABLE [dbo].[T_BIOPSY] ADD CONSTRAINT [FK__T_BIOPSY__MEDICA__503BEA1C] FOREIGN KEY ([MEDICAL_PROCEDURE_ID]) REFERENCES [dbo].[T_MEDICAL_PROCEDURE] ([MEDICAL_PROCEDURE_ID])
GO
ALTER TABLE [dbo].[T_BIOPSY] ADD CONSTRAINT [FK__T_BIOPSY__PRODUC__4D5F7D71] FOREIGN KEY ([PRODUCT_ID]) REFERENCES [dbo].[T_PRODUCT] ([PRODUCT_ID])
GO
